import { lazy } from "react";
import { Navigate } from 'react-router-dom'
import { FriendsO, HomeO, Search, SettingO } from '@react-vant/icons'
const Detail = lazy(() => import('../promise/Detail'))
const Home = lazy(() => import('../promise/Home'))
const Login = lazy(() => import('../promise/Login'))
const My = lazy(() => import('../promise/My'))
const MyLayout = lazy(() => import('../promise/MyLayout'))
const Outlist = lazy(() => import('../promise/Outlist'))
const Realist = lazy(() => import('../promise/Realist'))

export const tabbars = [
    {
        path: '/home',
        element: <Home />,
        title: '首页',
        icon:<FriendsO/>
    },
    {
        path: '/outlist',
        element: <Outlist />,
        title: '订单',
        icon:<FriendsO/>
    },
    {
        path: '/my',
        element: <My />,
        title: '我的',
        icon:<FriendsO/>
    },
]
export const routes = [
    {
        path: '/',
        element: <MyLayout></MyLayout>,
        children: [
            ...tabbars,
            {
                path: '/',
                element: <Navigate to='/home'></Navigate>
            }
        ]
    },
    {
        path: '/login',
        element: <Login />,
    },
    {
        path: '/detail',
        element: <Detail />,
    }
]